|
|
@@ -325,7 +325,11 @@ def mqtt_upload_temperature(payload):
|
325
|
325
|
except IsolationPointUserInfo.DoesNotExist:
|
326
|
326
|
ipui = None
|
327
|
327
|
if ipui:
|
328
|
|
- temperature__max = ThermometerMeasureLogInfo.objects.filter(point_id=eqpt.point_id, macid=macid).aggregate(Max('temperature')).get('temperature__max') or 0
|
|
328
|
+ temperature__max = ThermometerMeasureLogInfo.objects.filter(
|
|
329
|
+ point_id=eqpt.point_id,
|
|
330
|
+ macid=macid,
|
|
331
|
+ created_at=tc.utc_datetime(hours=-1),
|
|
332
|
+ ).aggregate(Max('temperature')).get('temperature__max') or 0
|
329
|
333
|
ipui.observed_ymds = list(set(ipui.observed_ymds + [tc.local_string(format='%Y-%m-%d')]))
|
330
|
334
|
ipui.observed_days = len(ipui.observed_ymds)
|
331
|
335
|
ipui.temperature = temperature__max
|